/**
 * QueryPage.java
 * Product:BaseLayer
 * Version:1.0
 * Copyright 2009 by DNE
 * All Rights Reserved.
 */
package com.site.util.extremetable;

import java.io.Serializable;
import java.util.Map;
import org.extremecomponents.table.limit.Limit;


public class QueryPage implements Serializable {
	

	/**
	 *
	 */
	private static final long serialVersionUID = 7290328507994026392L;
	/**定义默认每页中显示记录数**/
	public static final int DEFAULT_PAGE_SIZE = 10;
	public static final int MOBILE_DEFAULT_PAGE_SIZE = 5;
	
	public QueryPage(Limit limit) {
		this.pageSize = limit.getCurrentRowsDisplayed();
		this.targetPage = limit.getPage();
		this.sortMap = ExtremeTablePageUtil.getSort(limit);
		this.filterMap= ExtremeTablePageUtil.getFilterMap(limit);
	}
	
	public QueryPage() {
	}
	
	
	private Map<String,String> sortMap = null; //排序的参数
	
	private Map<String,String> filterMap = null; 

	private int pageSize = DEFAULT_PAGE_SIZE;// 每页记录数

	private int pageCount;// 总页数

	private int recordCount;// 总记录数

	private int targetPage;// 目标页
	
	
	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getPageCount() {
		return pageCount;
	}

	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}

	public int getRecordCount() {
		return recordCount;
	}

	public void setRecordCount(int recordCount) {
		this.recordCount = recordCount;
	}

	public int getTargetPage() {
		return targetPage;
	}

	public void setTargetPage(int targetPage) {
		this.targetPage = targetPage;
	}


	
	public boolean isSorted(){
		return sortMap != null;
	}

	public Map<String, String> getSortMap() {
		return sortMap;
	}

	public void setSortMap(Map<String, String> sortMap) {
		this.sortMap = sortMap;
	}

	public Map<String, String> getFilterMap() {
		return filterMap;
	}

	public void setFilterMap(Map<String, String> filterMap) {
		this.filterMap = filterMap;
	}

}